package com.ming.base.authority.dao;

import java.util.Set;

import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import com.ming.core.exception.BaseException;

/**
 * 角色DAO
 * @author chenhuaming
 * @Time：2017年2月22日 下午4:41:01
 * @version 1.0
 */
@Repository("roleDao")
public interface RoleDao {
	/**
	 * 根据账号查询所具有的权限
	 * getRoles:() 
	 * @author chenhuaming 
	 * @param loginAccount 
	 * @return
	 * @throws BaseException
	 */
	@Select(" SELECT role_code "
			+ " FROM sys_role r "
			+ " JOIN sys_user_role ur ON ur.role_id=r.role_id "
			+ " JOIN sys_user u ON u.user_id=ur.user_id "
			+ " WHERE u.login_account=#{loginAccount} ")
	public Set<String> getRoles(String loginAccount) throws BaseException;
}
